"use strict"

import Ajax from "../libs/ajax";
import Constant from "../libs/constants";

export default {
    setLocalConfig(data) {
        return Ajax.ajax({
            url: Constant.URL_SET_LOCALCONFIG,
            data: data,
            method: 'post'
        }).then(json => json.data)
    },
    getLocalConfig() {
        return Ajax.ajax({
            url: Constant.URL_GETALL_IPCONFIG,
            method: 'get'
        }).then(json => json.data)
    },
    getLocalIpConfig() {
        return Ajax.ajax({
            url: Constant.URL_GET_LOCALCONFIG,
            method: 'get'
        }).then(json => json.data)
    },
    setLocalIpConfig(data) {
        return Ajax.ajax({
            url: Constant.URL_SET_LOCALIPCONFIG,
            data: data,
            method: 'post'
        }).then(json => json.data)
    },
    restartConfig() {
        return Ajax.ajax({
            url: Constant.URL_RESTART_LOCALCONFIG,
            method: 'post'
        }).then(json => json.data)
    },
    cleanCache() {
        return Ajax.ajax({
            url: Constant.URL_CACHE_CLEAN,
            method: 'post'
        }).then(res => res.data)
    }
}